package com.itheima.dao;

import com.itheima.pojo.Goods;
import org.springframework.data.elasticsearch.repository.ElasticsearchCrudRepository;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

/**
 * @Author weizhongli
 * @Date 2020/5/6
 * @Version v1.0
 * @Description  操作商品索引库
 **/
public interface GoodsDao  extends ElasticsearchRepository<Goods,Long> {

    /**
     * 根据title和价格查询，and的关系
     */
    List<Goods> findAllByTitleAndPrice(String title, Double price);
    /**
     * 根据商品价格范围查询
     * 最低价格lowPrice
     * 最高价格highPrice
     */
    List<Goods> findByPriceBetween(Double lowPrice,Double highPrice);
}
